<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@page import="crm.control.PurchaseControl"%>
<%@page import="crm.model.Purchase"%>
<%@page import="crm.control.RecepitControl"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="stylesheet" href="../../../resources/css/reset.css" type="text/css" media="screen" />
<link rel="stylesheet" href="../../../resources/css/inner.css" type="text/css" media="screen" />
<style type='text/css'>
 a{font-size:12px; text-decoration:none; color:#70B300;}
</style>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
	</head>
	<body>
		<%
			request.setCharacterEncoding("UTF-8");
			int id = Integer.parseInt(request.getParameter("id"));
			Purchase purchase = new Purchase();
			purchase = PurchaseControl.getPurchaseById(id);
			//System.out.println(id);
		%>
		<table>
			<tr>
				<td>
					物品名称
				</td>
				<td>
					<%
						out.print(purchase.getGoods_name());
					%>
				</td>
				</tr>
				<tr>
				<td>
					单价
				</td>
				<td>
					<%
						out.print(purchase.getSingle_price());
					%>
				</td>
				</tr>
				<tr>
				<td>
					数量
				</td>
				<td>
					<%
						out.print(purchase.getGoods_num());
					%>
				</td>
			</tr>
			<tr>
				<td>
					总支出
				</td>
				<td>
					<%
						out.print(purchase.getSum_fee());
					%>
				</td>
				</tr>
				<tr>
				<td>
					购买地
				</td>
				<td>
					<%
						out.print(purchase.getPlace());
					%>
				</td>
				</tr>
				<tr>
				<td>
					购买时间
				</td>
				<td>
					<%
						out.print(purchase.getTime());
					%>
				</td>
			</tr>
			<tr>
				<td>
					购买人
				</td>
				<td>
					<%
						out.print(purchase.getPerson());
					%>
				</td>
			</tr>
				<tr>
				<td>
					出售者
				</td>
				<td>
					<%
						out.print(purchase.getSeller());
					%>
				</td>
				</tr>
				<tr>
				<td>
					联系方式
				</td>
				<td>
					<%
						out.print(purchase.getSeller_contact());
					%>
				</td>
			</tr>
			<%if(purchase.getRecepit_id()>0){ %>
				<tr>
				<td>
					关联的跟单名称
				</td>
				<td>
					<%
						out.print(RecepitControl.getRecepitById(purchase.getRecepit_id()).getTitle());
					%>
				</td>
			</tr>
			<%} %>			
		</table>
		
	</body>
</html>